

namespace WeatherGrpc
{
    using System.Threading.Tasks;
    using Grpc.Core;
    using Microsoft.Extensions.Logging;
    using WeatherGrpc.Protos;
    public class WeatherChecker : WeatherGrpc.Protos.WeatherChecker.WeatherCheckerBase
    {
        private readonly ILogger<WeatherChecker> _logger;
        public WeatherChecker(ILogger<WeatherChecker> logger)
        {
            _logger = logger;
        }

        public override Task<WeatherConditionResponse> CheckWeatherCondition(WeatherConditionRequest request, ServerCallContext context)
        {
            return Task.FromResult(new WeatherConditionResponse
            {
                Message = request.Condition != "Freezing"
            });
        }
    }
}
